home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_10_1986_Transactor_Publishing.d64 / head cleaner (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  926b  |  39 lines

  1. 100 rem* improved 1541 head cleaning prg *
  2. 110 print"[147]insert cleaning disk and hit return"
  3. 120 geta$:ifa$<>chr$(13)then120
  4. 130 open 15,8,15:print#15,"m-e"chr$(126)chr$(249)
  5. 140 rem locate head
  6. 150 print#15,"m-r"chr$(24)chr$(0)
  7. 160 get#15,a$:x=asc(a$+chr$(0))
  8. 165 if x=0 then end
  9. 170 print"drive head at track #"x
  10. 180 rem read $1c00
  11. 190 print#15,"m-r"chr$(0)chr$(28)
  12. 200 get#15,sc$:sc=asc(sc$+chr$(0))
  13. 210 rem select bits 0 and 1
  14. 220 bt=sc and 3
  15. 230 rem # tracks to 1
  16. 240 sp=2*(x-1)
  17. 250 rem move head to track 1
  18. 260 print"stepping to track #1"
  19. 270 for y=1 to sp
  20. 280 bt=bt-1:bt=bt and 3
  21. 290 s=(sc and 252)or bt
  22. 300 print#15,"m-w"chr$(0)chr$(28)chr$(1)chr$(s)
  23. 310 next y
  24. 320 rem step out to 35
  25. 330 print"stepping out to track # 35..."
  26. 340 print#15,"m-r"chr$(0)chr$(28)
  27. 350 get#15,a$:sc=asc(a$+chr$(0))
  28. 360 bt=sc and 3
  29. 370 for y=1 to 68
  30. 380 print"track #"int(y/2+1)
  31. 390 print"[145][145][145][145]"
  32. 400 bt=bt+1: bt=bt and 3
  33. 410 s=(sc and 252) or bt
  34. 420 print#15,"m-w"chr$(0)chr$(28)chr$(1)chr$(s)
  35. 430 ford=1to220:nextd
  36. 440 next y
  37. 450 print#15,"m-e"chr$(232)chr$(249):close15
  38. 460 new: rem to prevent re-running without a normal disk operation first
  39.